Dots & Pixels contains some C++ classes to generate random dot and random pixel displays. Two example programs, Differential and Transparency, are included. Both names are misnomers, since the programs have grown in scope over time. Differential shows the random dot display capabilities of the library, Transparency shows some random pixel display capabilities.
Dots & Pixels is written by Reinder Verlinde (reinder@neuretp.biol.ruu.nl). It is free and may not be sold without permission. Use it at your own risk and modify it to your hearts content. However, please do not distribute it in modified form. If you find bugs or make some improvements please send them to me.
Caveats
This code comes with no warranty. The built programs may crash your Macintosh. Specifically, the 68k versions assume the presence of at least a 68020 and a coprocessor, and the PPC versions assume a PowerMac. Also, the applications make a lot of assumptions as to the available hardware. Things which may cause problems are:
• The ‘pixels’ parts need a monitor which can be switched to 1-bit and to
2-bit depths (well, at least for the demonstration program. The code is
usable at 4, 8, 16, and 32 bit monitor depths as well)
• The ‘dots’ parts need a monitor which can be switched to 8-bit depth.
• Virtual memory may lead to troubles if and when the VBL routine and/or the
memory it writes to gets swapped out (AFAIK, the routine does not get
swapped out because it is in the System heap, but I am not 100% sure of
that; the memory it writes to is in the application heap, and may get
swapped out) Anyway, running experiments with virtual memory on is a
thing to avoid (while it is still possible; the future PowerMac will
always have virtual memory on)
• 32-bit memory must be enabled in the memory control panel (actually you may
get away with 24-bit memory manager, but 24-bit is a thing of the past; if
you still have programs which require it you should consider upgrading
these)
There probably are lots of others. When in doubt, read the sources.
Starting out
1. You should read the Caveats above, and read ‘Differential about’ and ‘Transparency about’.
2. Having done that, you can go out and play with the demo programs Differential and Transparency. This should give an idea whether you want to use the code.
3. It is nice to know some C++, since most of the source is written in C++. I have included both Symantec C++ (68k) and CodeWarrior (PowerMac) projects. If you are using another compiler you can read the file ‘Project contents’ to see what belongs where. If you don’t know anything about C++ it may prove hard to extend the library in a neat way.
4. Print out the sources of Differential and Transparency (‘differential main.cp’ and ‘transparency.cp’), and try to figure out what is going on.
5. Read any relevant header files.
6. If needed, also read the source files, and fix the bugs I left in. Mail me any fixes you make.
Other code which may interest you
If you find this code useful you may also be interested in the VideoToolbox by Denis Pelli. A short quote from his documentation:
The VideoToolbox is a collection of two hundred C subroutines and several
demo and utility programs that I and others have written to do visual
psychophysics with Macintosh computers. It is fully compatible with 680x0
and PowerPC Macs and with Metrowerks CodeWarrior 6/7 and Symantec THINK 7/8
C compilers. It's free and may not be sold without permission. It should
be useful to anyone who wants to present accurately specified visual
stimuli or use the Mac for psychometric experiments.
The VideoToolbox is available from the Info-Mac archive.